{% extends "file_manager/base.html" %}

{% block content %}
<div class="container mt-4">
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">图片预览: {{ file_name }}</h5>
            <a href="{% url 'download' file_path=file_path %}" class="btn btn-sm btn-primary">下载</a>
        </div>
        <div class="card-body text-center">
            {% if file_path and file_path|length > 0 %}
                <img src="{% url 'download' file_path=file_path %}"
                     class="img-fluid"
                     style="max-height: 80vh; max-width: 100%;"
                     alt="{{ file_name }}">
            {% else %}
                <p class="text-danger">图片路径无效</p>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
